package co.edu.udem.service.place;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import co.edu.udem.dao.PlaceDao;
import co.edu.udem.domain.Place;
import co.edu.udem.domain.SubjectDetail;
import co.edu.udem.service.GenericDTO;
import co.edu.udem.service.GenericService;

/**
 * @since 25/07/2012
 */
@Service("placeService")
public class PlaceService implements GenericService {

	@Autowired
	private PlaceDao placeDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see co.edu.udem.service.GenericService#getObjectList(java.util.Date,
	 * java.lang.String[][], java.lang.Object[])
	 */
	public List<GenericDTO> getObjectList(Date serviceDate, String[][] orderBy,
			Object... params) {
		return PlaceDTO.populateDTOList(placeDao.getObjectList(serviceDate,
				orderBy, params));
	}

	public void save(Place place) {
		placeDao.save(place);
	}

	public List<Place> getPlaceListByCriteria(String subjectDetailCode) {
		return placeDao.getPlaceListByCriteria(subjectDetailCode);
	}
	
	public Place getPlaceById(String placeCode) {
		return placeDao.getPlaceById(placeCode);
	}
	
	public void delete(String placeCode) {
		placeDao.delete(placeCode);
	}

}
